package util

import (
	"fmt"
	"gopkg.in/yaml.v2"
	"io/ioutil"
)

type Yaml struct {
	Path string
}

func (y *Yaml) Load(config interface{}) {
	file, err := ioutil.ReadFile(y.Path)
	if err != nil {
		panic(err)
	}
	err = yaml.Unmarshal(file, config)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(config)
}
